<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">

	<title>DWDownloader Class Reference</title>

	<link rel="stylesheet" href="../css/style.css">
	<meta name="viewport" content="initial-scale=1, maximum-scale=1.4">
	<meta name="generator" content="appledoc 2.2.1 (build 1334)">
</head>
<body class="appledoc">
	<header>
		<div class="container" class="hide-in-xcode">
			
			<h1 id="library-title">
				<a href="../index.html">CCSDK2.3.11 </a>
			</h1>

			<p id="developer-home">
				<a href="../index.html">cc</a>
			</p>
			
		</div>
	</header>

	<aside>
		<div class="container">
			<nav>
				<ul id="header-buttons" role="toolbar">
					<li><a href="../index.html">Index</a></li>
<li><a href="../hierarchy.html">Hierarchy</a></li>

					<li id="on-this-page" role="navigation">
						<label>
							On This Page

							<div class="chevron">
								<div class="chevy chevron-left"></div>
								<div class="chevy chevron-right"></div>
							</div>

							<select id="jump-to">
	<option value="top">Jump To&#133;</option>
	

	
	
	<option value="tasks">Tasks</option>
	
	

	
	
	<optgroup label="Properties">
		
		<option value="//api/name/failBlock">failBlock</option>
		
		<option value="//api/name/finishBlock">finishBlock</option>
		
		<option value="//api/name/getPlayinfoBlock">getPlayinfoBlock</option>
		
		<option value="//api/name/playurl">playurl</option>
		
		<option value="//api/name/progressBlock">progressBlock</option>
		
		<option value="//api/name/remoteFileSize">remoteFileSize</option>
		
		<option value="//api/name/timeoutSeconds">timeoutSeconds</option>
		
	</optgroup>
	

	

	
	<optgroup label="Instance Methods">
		
		<option value="//api/name/getPlayInfo">- getPlayInfo</option>
		
		<option value="//api/name/initWithUserId:andVideoId:key:">- initWithUserId:andVideoId:key:</option>
		
		<option value="//api/name/initWithUserId:andVideoId:key:destinationPath:">- initWithUserId:andVideoId:key:destinationPath:</option>
		
		<option value="//api/name/pause">- pause</option>
		
		<option value="//api/name/resume">- resume</option>
		
		<option value="//api/name/start">- start</option>
		
		<option value="//api/name/startWithUrlString:">- startWithUrlString:</option>
		
		<option value="//api/name/validateGetPlayinfo:">- validateGetPlayinfo:</option>
		
	</optgroup>
	
	
</select>
						</label>
					</li>
				</ul>
			</nav>
		</div>
	</aside>

	<article>
		<div id="overview_contents" class="container">
			<div id="content">
				<main role="main">
					<h1 class="title">DWDownloader Class Reference</h1>

					
					<div class="section section-specification"><table cellspacing="0"><tbody>
						<tr>
	<th>Inherits from</th>
	<td>NSObject</td>
</tr><tr>
	<th>Declared in</th>
	<td>DWDownloader.h<br />DWDownloader.m</td>
</tr>
						</tbody></table></div>
					

                    

					
					
					<div class="section section-tasks">
						<a title="Tasks" name="tasks"></a>
						

						
						<h2 class="task-title">Other Methods</h2>

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/getPlayinfoBlock" title="getPlayinfoBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/getPlayinfoBlock">&nbsp;&nbsp;getPlayinfoBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>获取视频下载信息。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWDownloaderGetPlayUrlsBlock getPlayinfoBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/timeoutSeconds" title="timeoutSeconds"></a>
	<h3 class="method-title"><code><a href="#//api/name/timeoutSeconds">&nbsp;&nbsp;timeoutSeconds</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>下载过程中HTTP通信请求超时时间。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (assign, nonatomic) NSTimeInterval timeoutSeconds</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/remoteFileSize" title="remoteFileSize"></a>
	<h3 class="method-title"><code><a href="#//api/name/remoteFileSize">&nbsp;&nbsp;remoteFileSize</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>要下载的文件在远程服务器上的字节数。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (assign, nonatomic) NSInteger remoteFileSize</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/progressBlock" title="progressBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/progressBlock">&nbsp;&nbsp;progressBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>在该block获取下载进度，可以在block内更新UI，如更新下载进度条。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWDownloaderProgressBlock progressBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/finishBlock" title="finishBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/finishBlock">&nbsp;&nbsp;finishBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>下载完成时回调该block，可以在block内更新UI，如将视频标记为下载完成。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWDownladerFinishBlock finishBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/failBlock" title="failBlock"></a>
	<h3 class="method-title"><code><a href="#//api/name/failBlock">&nbsp;&nbsp;failBlock</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>下载失败时回调该block，可以在该block内更新UI，如将视频标记为下载失败。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (copy, nonatomic) DWErrorBlock failBlock</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/initWithUserId:andVideoId:key:destinationPath:" title="initWithUserId:andVideoId:key:destinationPath:"></a>
	<h3 class="method-title"><code><a href="#//api/name/initWithUserId:andVideoId:key:destinationPath:">&ndash;&nbsp;initWithUserId:andVideoId:key:destinationPath:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>初始化 DWDownloader</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (id)initWithUserId:(NSString *)<em>userId</em> andVideoId:(NSString *)<em>videoId</em> key:(NSString *)<em>key</em> destinationPath:(NSString *)<em>path</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>userId</code></th>
						<td><p>用户ID，不能为nil</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>videoId</code></th>
						<td><p>视频ID，不能为空</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>key</code></th>
						<td><p>用户秘钥，不能为nil</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>path</code></th>
						<td><p>下载视频的保存路径，不能为nil</p>

<p>注意：</p>

<p>若你所下载的 <a href="#//api/name/videoId">videoId</a> 未启用视频加密功能，则保存的文件扩展名[必须]是 mp4，否则无法播放。</p>

<p>若你所下载的 <a href="#//api/name/videoId">videoId</a> 启用了视频加密功能，则保存的文件扩展名[必须]是 pcm，否则无法播放。</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>下载对象</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/initWithUserId:andVideoId:key:" title="initWithUserId:andVideoId:key:"></a>
	<h3 class="method-title"><code><a href="#//api/name/initWithUserId:andVideoId:key:">&ndash;&nbsp;initWithUserId:andVideoId:key:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>初始化 DWDownloader</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (id)initWithUserId:(NSString *)<em>userId</em> andVideoId:(NSString *)<em>videoId</em> key:(NSString *)<em>key</em></code></div>

		    
			
			<div class="method-subsection arguments-section parameters">
				<h4 class="method-subtitle parameter-title">Parameters</h4>
				<table class="argument-def parameter-def">
				
					<tr>
						<th scope="row" class="argument-name"><code>userId</code></th>
						<td><p>用户ID，不能为nil</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>videoId</code></th>
						<td><p>视频ID，不能为空</p></td>
					</tr>
				
					<tr>
						<th scope="row" class="argument-name"><code>key</code></th>
						<td><p>用户秘钥，不能为nil
该初始方法仅为获取视频下载信息使用</p></td>
					</tr>
				
				</table>
			</div>
			

			
			<div class="method-subsection return">
				<h4 class="method-subtitle parameter-title">Return Value</h4>
				<p>下载对象</p>
			</div>
			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/start" title="start"></a>
	<h3 class="method-title"><code><a href="#//api/name/start">&ndash;&nbsp;start</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>开始下载</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)start</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/pause" title="pause"></a>
	<h3 class="method-title"><code><a href="#//api/name/pause">&ndash;&nbsp;pause</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>暂停下载</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)pause</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/resume" title="resume"></a>
	<h3 class="method-title"><code><a href="#//api/name/resume">&ndash;&nbsp;resume</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>继续下载</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)resume</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/getPlayInfo" title="getPlayInfo"></a>
	<h3 class="method-title"><code><a href="#//api/name/getPlayInfo">&ndash;&nbsp;getPlayInfo</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>获取下载视频信息</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)getPlayInfo</code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div><div class="section-method">
	<a name="//api/name/startWithUrlString:" title="startWithUrlString:"></a>
	<h3 class="method-title"><code><a href="#//api/name/startWithUrlString:">&ndash;&nbsp;startWithUrlString:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>按下载地址下载视频</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (void)startWithUrlString:(NSString *)<em>urlString</em></code></div>

		    
			

			

			

			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.h</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						

						
						<h2 class="task-title">Other Methods</h2>

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/validateGetPlayinfo:" title="validateGetPlayinfo:"></a>
	<h3 class="method-title"><code><a href="#//api/name/validateGetPlayinfo:">&ndash;&nbsp;validateGetPlayinfo:</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<ul>
<li>如果 self.<a href="#//api/name/urlString">urlString</a> 不为 nil，则优先使用 self.<a href="#//api/name/urlString">urlString</a> 下载。否则使用 self.userId、self.videoId、self.<a href="#//api/name/key">key</a> 访问playinfo接口获取播放url再下载。</li>
<li>如果 self.<a href="#//api/name/urlString">urlString</a> 为 nil，那么 self.userId、self.videoId、self.<a href="#//api/name/key">key</a> 都不能为nil。否则报错。</li>
</ul>

			</div>
			
		    

			<div class="method-subsection method-declaration"><code>- (BOOL)validateGetPlayinfo:(NSError **)<em>error</em></code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<ul>
<li>如果 self.<a href="#//api/name/urlString">urlString</a> 不为 nil，则优先使用 self.<a href="#//api/name/urlString">urlString</a> 下载。否则使用 self.userId、self.videoId、self.<a href="#//api/name/key">key</a> 访问playinfo接口获取播放url再下载。</li>
<li>如果 self.<a href="#//api/name/urlString">urlString</a> 为 nil，那么 self.userId、self.videoId、self.<a href="#//api/name/key">key</a> 都不能为nil。否则报错。</li>
</ul>

			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.m</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						

						<a title="Extension Methods" name="task_Extension Methods"></a>
						<h2 class="task-title">Extension Methods</h2>

						<div class="task-list">
							<div class="section-method">
	<a name="//api/name/playurl" title="playurl"></a>
	<h3 class="method-title"><code><a href="#//api/name/playurl">&nbsp;&nbsp;playurl</a></code>
</h3>

	<div class="method-info">
		<div class="pointy-thing"></div>

		<div class="method-info-container">
			
			
			<div class="method-subsection brief-description">
				<p>当前下载视频的url信息。</p>
			</div>
			
		    

			<div class="method-subsection method-declaration"><code>@property (strong, nonatomic) NSDictionary *playurl</code></div>

		    
			

			

			

			
			<div class="method-subsection discussion-section">
				<h4 class="method-subtitle">Discussion</h4>
				<p>当前下载视频的url信息。</p>

<p>NSDictionary: {&ldquo;UPID&rdquo;:NSString, &ldquo;quality&rdquo;:NSNumber, &ldquo;desp&rdquo;:NSString, &ldquo;priority&rdquo;:NSNumber, &ldquo;playurl&rdquo;:NSString}</p>
			</div>
			

			

			

			
			<div class="method-subsection declared-in-section">
				<h4 class="method-subtitle">Declared In</h4>
				<p><code class="declared-in-ref">DWDownloader.m</code></p>
			</div>
			
			
		</div>
	</div>
</div>
						</div>
						
					</div>
					
					

                    
                    
          
				</main>

				<footer>
					<div class="footer-copyright">
						
						<p class="copyright">Copyright &copy; 2015 cc. All rights reserved. Updated: 2015-11-10</p>
						
						
						<p class="generator">Generated by <a href="http://appledoc.gentlebytes.com">appledoc 2.2.1 (build 1334)</a>.</p>
						
					</div>
				</footer>
			</div>
		</div>
	</article>

	<script src="../js/script.js"></script>
</body>
</html>